import Http from '../http';
import { SysButton } from '@/model/button/button';

//新增按钮
export const insert = function (sysButton: SysButton) {
    return Http.post('/api/SysButton/Insert', sysButton)
}

//编辑按钮
export const update = function (sysButton: SysButton) {
    return Http.post('/api/SysButton/Update', sysButton)
}

//获取公司、系统、菜单、按钮关系数据
export const getAllButtonList = function () {
    return Http.get('/api/SysButton/GetAllButtonList')
}

 //获取按钮数据
 export const getButtonList = async function (pageResultModel:any) {
  return await Http.post('/api/SysButton/GetButtonList',pageResultModel);
}

//获取公司、系统、菜单、按钮关系数据
export const getSystemMenuButtonList = function (params: { corporationKey: string, systemKey: string }) {
    return Http.get('/api/SysButton/GetSystemMenuButtonList',params)
}

//获取菜单按钮权限
export  const  getMenuButtonAuthList = async function (params: { menuId: string, buttonRoleType: number }) {
    return await Http.get('/api/SysButton/GetMenuButtonAuthList',params)
}

//获取菜单按钮权限
export  const  getMenuButtonList = async function (params: { menuId: string, buttonRoleType: number }) {
    return await Http.get('/api/SysButton/GetMenuButtonList',params)
}